package com.example.zk2.adapter

import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.zk2.GlideUtils
import com.example.zk2.R
import com.example.zk2.entity.GoodsEntity

class GoodsAdapter(list: MutableList<GoodsEntity>):BaseQuickAdapter<GoodsEntity,BaseViewHolder>(R.layout.item_goods,list) {
    override fun convert(holder: BaseViewHolder, item: GoodsEntity) {
        holder.setText(R.id.goods_desc,item.goods_desc)
        holder.setText(R.id.goods_price,"${item.goods_default_price}元")
        GlideUtils.loadPic(context,item.goods_default_icon,holder.getView(R.id.goods_iv))
    }
}